<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.8.0.js"></script>
<script type="text/javascript">
    $(function(){
		  $("input").keydown(function(){
			  $("input").css("background-color","#FFFFCC")
			  }).keyup(function(){
				   $("input").css("background-color","skyblue");
				  })
		});
</script>
</head>

<body>
enter you name:<input type="text"/>
<p>当生发keydown和keyup事件时，文本框会发生颜色改变.请试着在其中输入内容!</p>
</body>
</html>
